<template>
	<view class="fee">
		<view class="u-padding-20">
			<u-search placeholder="请输入需要搜索内容" shape="square" v-model="keyword"></u-search>
		</view>
		
		<view class="con-body" style="background-color: #F2F3F5;">

			<view style="background-color: #FFFFFF;margin-top: 1px;">
				<u-tabs :list="tabs" bold='true' activeColor="#0B868E" :current="current" @change="changeTabs">
				</u-tabs>
			</view>

			<u-empty :show="showEmpty" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
			</u-empty>
			<view class="uni-flex-center" v-for="(item, index) in repairList" v-key='index'>
				<view class="main-service uni-cell-90" style="padding-bottom: 10rpx; width: 96%; margin-left: 2%;">
					<view class="user-list">
						<view class="title u-rela">
							<view class="u-abso pos_left">
								<text>工单编号：{{item.code}}</text>
							</view>
							<view class="u-abso pos_right" v-if="item.status==0">
								<text style="color:#007AFF;">{{item.status_label}}</text>
							</view>
							<view class="u-abso pos_right" v-if="item.status==1">
								<text style="color:#18B566;">{{item.status_label}}</text>
							</view>
						</view>
						<u-line></u-line>
						<view class="u-padding-20">
							<view class="d_view u-margin-bottom-20">
								<text class="l_title">报修楼号</text>
								<text class="d_content">{{item.house}}</text>
							</view>

							<view class="d_view">
								<text class="l_title">报修类型</text>
								<text class="d_content">{{item.type}}</text>
							</view>
						</view>
						<view style="clear: both;"></view>
						<u-modal :show="showDel" title="提示" width="500rpx" @cancel="showDel = false" :content='item.status == 0 ? "确定撤销报修吗？" : "确定删除报修么？"' showCancelButton></u-modal>
					</view>
				</view>
			</view>

		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				tabs: [{
						name: '全部'
					},
					{
						name: '待处理'
					},
					{
						name: '处理中'
					},
					{
						name: '已处理'
					},
					{
						name: '已关闭'
					}
				],
				repairList: [
					{
						id:0,
						code:1235,
						status_label:'待处理',
						house:'一号楼一单元202',
						type:'水暖维修',
						status:0
					},
					{
						id:1,
						code:1235,
						status_label:'已完成',
						house:'一号楼一单元202',
						type:'水暖维修',
						status:1
					}
				],
				showDel: false,
				showEmpty: false,
				keyword:''
			}
		},
		onLoad() {
			// getRepair().then(this.getRepair);
		},
		methods: {
			
			changeTabs(e) {
				let par;
				// console.log(e);
				this.current = e;
				switch (this.current) {
					case 1:
						par = {
							status: 0
						};
						break;
					case 2:
						par = {
							status: 2
						};
						break;
					case 3:
						par = {
							status: 1
						};
						break;
					case 4:
						par = {
							status: -1
						};
						break;
					default:
						par = {
							status: 99
						};
				}
			},
			
		}
	}
</script>

<style>
	.l_title {
		color: #999;
		float: left;
	}

	.d_content {
		color: #666;
	}

	.d_view {
		font-size: 28rpx;
		color: #999;
		/* margin-top: 30rpx; */
		text-align: right;
	}
	.main-service {
		margin-top: 20upx;
		border-radius: 10upx;
		background: #ffffff;
		box-shadow: 5rpx 5rpx 20rpx rgba(0, 0, 0, 0.15);
	}
	
	.main-service .title {
		height:70rpx;
		line-height: 70rpx;
		font-size: 30rpx;
	}
	
	
	
</style>
